package com.luoyuanxiangvip.core.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.luoyuanxiangvip.common.vo.BizArticleVO;
import com.luoyuanxiangvip.core.entity.BizArticle;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 文章 Mapper 接口
 * </p>
 *
 * @author luoyuanxiang <p>luoyuanxiangvip.com</p>
 * @since 2019-05-30
 */
public interface BizArticleMapper extends BaseMapper<BizArticle> {

    /**
     * 分页
     *
     * @param page 分页对象
     * @return PageUtil
     */
    IPage<BizArticle> findPageBreakByCondition(@Param("page") Page<BizArticle> page, @Param("bizArticleVO") BizArticleVO bizArticleVO);

    /**
     * 获取文章详情
     * @param id 文章id
     * @param status 状态
     * @return BizArticle
     */
    BizArticle info(Long id, Boolean status);

    /**
     * 获取文章数
     * @param id 分类id
     * @return long
     */
    Long countByCategoryId(Long id);
}
